/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-06-07 14:37:48
 * @LastEditTime : 2023-06-07 14:41:20
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Router\MenuNav\ThrRouter\PersonGroup.jsx
 * @Description  :
 */

import { API_LIST } from '../../../Api/Api'
import { commonTableList } from '../Common/common'
import { PersonTypeTree } from '../Common/Conversion'

export const PersonGroup = async ({ twoData, ClientData }) => {
    const personTypeUuid = await PersonTypeTree()
    let dataList = {
        uuid: twoData.uuid,
        isCheckbox: true,
        pageSize: 10,
        params: { pageIndex: 1 },
        get: API_LIST()['getPersonGroupDetailGetNoGroupPersonDetails'],
        pos: 'posPersonGroupDetail',
        assemblyData: e => e.map(item => ({ personGroupUuid: twoData.uuid, personUuid: item.uuid })),
        columns: [
            commonTableList.uuid,
            { ...commonTableList.organizationUuid, valueEnum: ClientData.organization },
            {
                dataIndex: 'tableName',
                title: '人员姓名',
                valueType: 'input',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'personTypeUuid',
                title: '人员类别',
                valueType: 'treeSelect',
                fieldProps: {
                    options: personTypeUuid,
                    fieldNames: { label: 'tableName', value: 'uuid' },
                },
                rules: true,
                width: 150,
            },
        ],
    }
    return dataList
}
